package com.zaofan.dao;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;

import com.zaofan.bean.ProductAttr;
import com.zaofan.dao.base.DaoSupportImpl;

public class ProductAttrDao extends DaoSupportImpl<ProductAttr> {

	public void deleteAttrByProductId(int productId) {
		try {
			String sql = "delete from " + ProductAttr.class.getSimpleName().toLowerCase() + " where productId = " + productId;
			System.err.println(sql);
			QueryRunner runner = new QueryRunner(getDataSource());
			runner.update(sql);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

}
